home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / AppMaker 2.0b3 / Demo AppMaker 1.5 / Demo AppMaker™ / Demo AppMaker™.rsrc / TmpC_403_DoMenuItem.Edit < prev    next >
Encoding:
Text File  |  1992-04-08  |  3.1 KB  |  133 lines

  1. %if MenuItemName = Cut%
  2.     /*----------*/
  3.     static void DoCut (void)
  4.     {
  5.         if (cur->text != nil) {
  6.             TECut (cur->text);
  7.             cur->dirty = true;
  8.             scrapDirty = true;
  9.         }
  10.     } /*DoCut*/
  11.  
  12. %elsif MenuItemName = Copy%
  13.     /*----------*/
  14.     static void DoCopy (void)
  15.     {
  16.         if (cur->text != nil) {
  17.             TECopy (cur->text);
  18.             scrapDirty = true;
  19.         }
  20.     } /*DoCopy*/
  21.  
  22. %elsif MenuItemName = Paste%
  23.     /*----------*/
  24.     static void DoPaste (void)
  25.     {
  26.         if (cur->text != nil) {
  27.             TEPaste (cur->text);
  28.             cur->dirty = true;
  29.         }
  30.     } /*DoPaste*/
  31.  
  32. %elsif MenuItemName = Clear%
  33.     /*----------*/
  34.     static void DoClear (void)
  35.     {
  36.         if (cur->text != nil) {
  37.             TEDelete (cur->text);
  38.             cur->dirty = true;
  39.         }
  40.     } /*DoClear*/
  41.  
  42. %elsif MenuItemName = SelectAll%
  43.     /*----------*/
  44.     static void DoSelectAll (void)
  45.     {
  46.         if (cur->text != nil) {
  47.             TESetSelect (0, 32767, cur->text);
  48.         }
  49.     } /*DoSelectAll*/
  50.  
  51. %elsif menuitemname = CreatePublisher%
  52.     /*----------*/
  53.     static void DoCreatePublisher (void)
  54.     {
  55.     #if 0
  56.         OSErr                theErr;
  57.         NewPublisherReply    pdReply;
  58.         
  59.     #include <Packages.h>
  60.         pdReply.usePart = false;
  61.         pdReply.preview = nil;                /*should be handle to and*/
  62.         pdReply.previewFormat = 'TEXT';        /*type of preview data*/
  63.     
  64.         /* fill in pdReply.container: */
  65.         HLock ((Handle)cur->filename);
  66.         theErr = FSMakeFSSpec(cur->volNum, 0L /*dirID*/, *cur->filename,
  67.                               &pdReply.container.theFile);
  68.                                     /*should really pass default edition name*/
  69.                                     /*instead of cur->filename*/
  70.         HUnlock ((Handle)cur->filename);
  71.         if (theErr == noErr) {        /* FSMakeFSSpec went ok */
  72.             pdReply.container.theFileScript = iuCurrentScript;
  73.                                                 /* should be script code for cur->filename */
  74.             pdReply.container.thePart = kPartsNotUsed;
  75.             pdReply.container.thePartName[0] = 0;        /* not used */
  76.             pdReply.container.thePartScript = 0;        /* not used */
  77.     
  78.             theErr = NewPublisherDialog (&pdReply);
  79.             if ((theErr == noErr) && (!pdReply.canceled)) {
  80.                 /* handle new publisher */
  81.             } /* otherwise, NewPublisherDialog error or user cancelled */
  82.         } else {
  83.             /* handle FSMakeFSSpec error */
  84.         }
  85.     #endif
  86.     } /*DoCreatePublisher*/
  87.  
  88. %elsif menuitemname = SubscribeTo%
  89.     /*----------*/
  90.     static void DoSubscribeTo (void)
  91.     {
  92.         OSErr                theErr;
  93.         NewSubscriberReply    sdReply;
  94.  
  95.         sdReply.formatsMask = kTEXTformatMask;
  96.         theErr = GetLastEditionContainerUsed (&sdReply.container);
  97.         theErr = NewSubscriberDialog (&sdReply);
  98.         if (!sdReply.canceled) {
  99.             /* handle subscriber to */
  100.         }
  101.     } /*DoSubscribeTo*/
  102.  
  103. %elsif menuitemname = SubscriberOptions%
  104.     /*----------*/
  105.     /* This procedure displays either the publisher options or */
  106.     /* subscriber options dialog, depending on what's selected. */
  107.     /*----------*/
  108.     static void DoSubscriberOptions (void)
  109.     {
  110.         OSErr                theErr;
  111.         SectionOptionsReply    soReply;
  112.  
  113.         theErr = SectionOptionsDialog (&soReply);
  114.         if ((theErr == noErr) && (!soReply.canceled)) {
  115.             switch (soReply.action) {
  116.                 case 'read':        /* "Get Edition Now" */
  117.                     break;
  118.                 case 'writ':        /* "Send Edition Now" */
  119.                     break;
  120.                 case 'goto':        /* "Open Publisher" */
  121.                     break;
  122.                 case 'cncl':        /* "Cancel Publisher/Subscriber" */
  123.                     break;
  124.                 case '    ':        /* "OK" */
  125.                     break;
  126.             } /* switch */
  127.         }
  128.     } /*DoSubscriberOptions*/
  129.  
  130. %else%
  131.     %DoMenuItem%
  132. %end if%
  133.